{
 "metadata": {
  "kernelspec": {
   "language": "python",
   "display_name": "Python 3",
   "name": "python3"
  },
  "language_info": {
   "name": "python",
   "version": "3.10.13",
   "mimetype": "text/x-python",
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "pygments_lexer": "ipython3",
   "nbconvert_exporter": "python",
   "file_extension": ".py"
  },
  "kaggle": {
   "accelerator": "gpu",
   "dataSources": [],
   "dockerImageVersionId": 30746,
   "isInternetEnabled": true,
   "language": "python",
   "sourceType": "notebook",
   "isGpuEnabled": true
  }
 },
 "nbformat_minor": 4,
 "nbformat": 4,
 "cells": [
  {
   "cell_type": "code",
   "source": "!wget http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar",
   "metadata": {
    "execution": {
     "iopub.status.busy": "2024-07-17T13:18:22.951276Z",
     "iopub.execute_input": "2024-07-17T13:18:22.952063Z",
     "iopub.status.idle": "2024-07-17T13:20:45.460982Z",
     "shell.execute_reply.started": "2024-07-17T13:18:22.952029Z",
     "shell.execute_reply": "2024-07-17T13:20:45.459938Z"
    },
    "trusted": true
   },
   "execution_count": 1,
   "outputs": []
  },
  {
   "cell_type": "code",
   "source": "!tar -xf VOCtrainval_11-May-2012.tar",
   "metadata": {
    "execution": {
     "iopub.status.busy": "2024-07-17T13:20:45.463702Z",
     "iopub.execute_input": "2024-07-17T13:20:45.464120Z",
     "iopub.status.idle": "2024-07-17T13:20:50.484967Z",
     "shell.execute_reply.started": "2024-07-17T13:20:45.464080Z",
     "shell.execute_reply": "2024-07-17T13:20:50.483852Z"
    },
    "trusted": true
   },
   "execution_count": 2,
   "outputs": []
  },
  {
   "cell_type": "code",
   "source": "!mkdir data\n!cp -r VOCdevkit/VOC2012/JPEGImages data\n!cp -r VOCdevkit/VOC2012/SegmentationClass data",
   "metadata": {
    "execution": {
     "iopub.status.busy": "2024-07-17T13:20:50.486474Z",
     "iopub.execute_input": "2024-07-17T13:20:50.486856Z",
     "iopub.status.idle": "2024-07-17T13:20:56.525441Z",
     "shell.execute_reply.started": "2024-07-17T13:20:50.486819Z",
     "shell.execute_reply": "2024-07-17T13:20:56.524153Z"
    },
    "trusted": true
   },
   "execution_count": 3,
   "outputs": []
  },
  {
   "cell_type": "code",
   "source": "!rm -rf VOCdevkit\n!rm -rf VOCtrainval_11-May-2012.tar",
   "metadata": {
    "execution": {
     "iopub.status.busy": "2024-07-17T13:20:56.527496Z",
     "iopub.execute_input": "2024-07-17T13:20:56.527935Z",
     "iopub.status.idle": "2024-07-17T13:21:00.176261Z",
     "shell.execute_reply.started": "2024-07-17T13:20:56.527895Z",
     "shell.execute_reply": "2024-07-17T13:21:00.175152Z"
    },
    "trusted": true
   },
   "execution_count": 4,
   "outputs": []
  },
  {
   "cell_type": "code",
   "source": "!git clone https://github.com/Sal1eri/voc2012.git",
   "metadata": {
    "execution": {
     "iopub.status.busy": "2024-07-17T13:21:00.179061Z",
     "iopub.execute_input": "2024-07-17T13:21:00.179422Z",
     "iopub.status.idle": "2024-07-17T13:21:40.674414Z",
     "shell.execute_reply.started": "2024-07-17T13:21:00.179391Z",
     "shell.execute_reply": "2024-07-17T13:21:40.673293Z"
    },
    "trusted": true
   },
   "execution_count": 5,
   "outputs": []
  },
  {
   "cell_type": "code",
   "source": "!mv data/ /kaggle/working/voc2012/",
   "metadata": {
    "execution": {
     "iopub.status.busy": "2024-07-17T13:21:40.676048Z",
     "iopub.execute_input": "2024-07-17T13:21:40.676914Z",
     "iopub.status.idle": "2024-07-17T13:21:41.685430Z",
     "shell.execute_reply.started": "2024-07-17T13:21:40.676877Z",
     "shell.execute_reply": "2024-07-17T13:21:41.684210Z"
    },
    "trusted": true
   },
   "execution_count": 6,
   "outputs": []
  },
  {
   "cell_type": "code",
   "source": "import torch\nprint(torch.__version__)\n!nvidia-smi",
   "metadata": {
    "execution": {
     "iopub.status.busy": "2024-07-17T13:21:41.686850Z",
     "iopub.execute_input": "2024-07-17T13:21:41.687146Z",
     "iopub.status.idle": "2024-07-17T13:21:45.863689Z",
     "shell.execute_reply.started": "2024-07-17T13:21:41.687118Z",
     "shell.execute_reply": "2024-07-17T13:21:45.862676Z"
    },
    "trusted": true
   },
   "execution_count": 7,
   "outputs": []
  },
  {
   "cell_type": "code",
   "source": "!mv */* ./",
   "metadata": {
    "execution": {
     "iopub.status.busy": "2024-07-17T13:21:45.865218Z",
     "iopub.execute_input": "2024-07-17T13:21:45.865811Z",
     "iopub.status.idle": "2024-07-17T13:21:46.854001Z",
     "shell.execute_reply.started": "2024-07-17T13:21:45.865780Z",
     "shell.execute_reply": "2024-07-17T13:21:46.852758Z"
    },
    "trusted": true
   },
   "execution_count": 8,
   "outputs": []
  },
  {
   "cell_type": "code",
   "source": "!sed -i 's/\\\\/\\//g' train.csv\n!sed -i 's/\\\\/\\//g' test.csv\n!sed -i 's/\\\\/\\//g' val.csv",
   "metadata": {
    "execution": {
     "iopub.status.busy": "2024-07-17T13:21:46.855615Z",
     "iopub.execute_input": "2024-07-17T13:21:46.855964Z",
     "iopub.status.idle": "2024-07-17T13:21:49.820235Z",
     "shell.execute_reply.started": "2024-07-17T13:21:46.855936Z",
     "shell.execute_reply": "2024-07-17T13:21:49.818898Z"
    },
    "trusted": true
   },
   "execution_count": 9,
   "outputs": []
  },
  {
   "cell_type": "code",
   "source": "#load train.py",
   "metadata": {
    "execution": {
     "iopub.status.busy": "2024-07-17T13:21:49.822331Z",
     "iopub.execute_input": "2024-07-17T13:21:49.822673Z",
     "iopub.status.idle": "2024-07-17T13:21:57.932774Z",
     "shell.execute_reply.started": "2024-07-17T13:21:49.822624Z",
     "shell.execute_reply": "2024-07-17T13:21:57.931697Z"
    },
    "trusted": true
   },
   "execution_count": 10,
   "outputs": []
  },
  {
   "cell_type": "code",
   "source": "!python train.py",
   "metadata": {
    "execution": {
     "iopub.status.busy": "2024-07-17T13:22:04.374596Z",
     "iopub.execute_input": "2024-07-17T13:22:04.375245Z"
    },
    "trusted": true
   },
   "execution_count": null,
   "outputs": []
  }
 ]
}
